<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<input type="button" class="opt" value="-"/>
<input type="text" id="res" value="2"/>
<input type="button" class="opt" value="+"/>
</body>
<script>
    $(function(){
        $(':button').click(function(){
            $('#res').val(eval($('#res').val() + $(this).val() + "1"));
        });
    })
</script> 
</html>